﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Script.Services;
using System.Web.Services;
using Entidades;
using Logica;

namespace SITAX
{
    public partial class RecogerPasajero : System.Web.UI.Page
    {
        public static string email;

        protected void Page_Load(object sender, EventArgs e)
        {
            Lbemail.Text = email;

            if (!IsPostBack)
            {
                if (Session["Emailc"] != null)
                {
                    Lbemail.Text = Session["Emailc"].ToString();
                   
                    //Session["Email"] = email;
                }

                if (Request.QueryString["email"] != null)
                {
                    Lbemail.Text = Request.QueryString["email"].ToString();
                }
                email = Lbemail.Text;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {

        }

        [WebMethod]
        [ScriptMethod(UseHttpGet = true)]
        public static ControlSolicitud GetSolicitud(string Email)
        {
            ControlBLL lgcontrol = new ControlBLL();
            ControlSolicitud con = lgcontrol.GetSolicitud(Email);
                       
            return con;
        }

      
        protected void TxEmail_TextChanged(object sender, EventArgs e)
        {
           
        }

        protected void TxTelefono_TextChanged(object sender, EventArgs e)
        {

        }

        protected void TxNombre_TextChanged(object sender, EventArgs e)
        {

        }

        protected void TxApellido_TextChanged(object sender, EventArgs e)
        {

        }

        protected void BtUbicacion_Click(object sender, EventArgs e)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "myScript", "<script>javascript:"+
                "window.location.href = 'Mapa.aspx?emailc=" + Lbemail.Text + "&emailp=" +TxEmail.Text+ "'"+";</script>");
        }

        protected void BtAceptar_Click(object sender, EventArgs e)
        {
            //ControlSolicitud con = new ControlSolicitud();
            //TaxiBLL lgtaxi = new TaxiBLL();
            //con.taxi= lgtaxi.getTaxi(Lbemail.Text);

            //con.pasajero.Email = TxEmail.Text;
            //con.respuesta = "1";
          

            //ControlBLL lgcontrol = new ControlBLL();
            //Label1.Text = lgcontrol.Actualizar(con);

        }

        protected void BtCancelar_Click(object sender, EventArgs e)
        {
            //ControlSolicitud con = new ControlSolicitud();
            //TaxiBLL lgtaxi = new TaxiBLL();
            //con.taxi = lgtaxi.getTaxi(Lbemail.Text);

            //con.pasajero.Email = TxEmail.Text;
            //con.respuesta = "0";


            //ControlBLL lgcontrol = new ControlBLL();
            //Label1.Text = lgcontrol.Actualizar(con);
        }

      
    }
}